<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Scripting Capabilities &mdash; porymap  documentation</title>
      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
    <link rel="shortcut icon" href="../_static/porymap-icon-2.ico"/>
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/sphinx_highlight.js"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Project Files" href="project-files.html" />
    <link rel="prev" title="The Tileset Editor" href="tileset-editor.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: linear-gradient(180deg, #08ACD5 50%, #FF6262 0%);" >

          
          
          <a href="../index.html" class="icon icon-home">
            porymap
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">User Manual</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a><ul>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#about-porymap">About Porymap</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#getting-started">Getting Started</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="navigation.html">Navigation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="navigation.html#map-list">Map List</a></li>
<li class="toctree-l2"><a class="reference internal" href="navigation.html#main-window">Main Window</a></li>
<li class="toctree-l2"><a class="reference internal" href="navigation.html#tileset-editor">Tileset Editor</a></li>
<li class="toctree-l2"><a class="reference internal" href="navigation.html#region-map-editor">Region Map Editor</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="editing-map-tiles.html">Editing Map Tiles</a><ul>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#visual-options">Visual Options</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#selecting-metatiles">Selecting Metatiles</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#pencil-tool">Pencil Tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#pointer-tool">Pointer Tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#bucket-fill-tool">Bucket Fill Tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#map-shift-tool">Map Shift Tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#smart-paths">Smart Paths</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#straight-paths">Straight Paths</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#change-map-border">Change Map Border</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#change-map-tilesets">Change Map Tilesets</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#undo-redo">Undo &amp; Redo</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-tiles.html#prefabs">Prefabs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="editing-map-collisions.html">Editing Map Collisions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="editing-map-collisions.html#selecting-collision-types">Selecting Collision Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-collisions.html#painting-collisions">Painting Collisions</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-collisions.html#collision-types">Collision Types</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="editing-map-events.html">Editing Map Events</a><ul>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#adding-deleting-events">Adding &amp; Deleting Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#event-positions">Event Positions</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#object-events">Object Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#clone-object-events">Clone Object Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#warp-events">Warp Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#trigger-events">Trigger Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#weather-trigger-events">Weather Trigger Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#sign-event">Sign Event</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#hidden-item-event">Hidden Item Event</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#secret-base-event">Secret Base Event</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#heal-location-healspots">Heal Location / Healspots</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#open-map-scripts">Open Map Scripts</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#tool-buttons">Tool Buttons</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-events.html#ruler-tool">Ruler Tool</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="editing-map-header.html">Editing Map Headers</a></li>
<li class="toctree-l1"><a class="reference internal" href="editing-map-connections.html">Editing Map Connections</a><ul>
<li class="toctree-l2"><a class="reference internal" href="editing-map-connections.html#dive-emerge-warps">Dive &amp; Emerge Warps</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-connections.html#mirror-connections">Mirror Connections</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-map-connections.html#follow-connections">Follow Connections</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="editing-wild-encounters.html">Editing Wild Encounters</a><ul>
<li class="toctree-l2"><a class="reference internal" href="editing-wild-encounters.html#adding-new-encounter-groups">Adding New Encounter Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="editing-wild-encounters.html#configuring-the-wild-encounter-fields">Configuring the Wild Encounter Fields</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="creating-new-maps.html">Creating New Maps</a><ul>
<li class="toctree-l2"><a class="reference internal" href="creating-new-maps.html#new-map-options">New Map Options</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="region-map-editor.html">The Region Map Editor</a><ul>
<li class="toctree-l2"><a class="reference internal" href="region-map-editor.html#background-image-tab">Background Image Tab</a></li>
<li class="toctree-l2"><a class="reference internal" href="region-map-editor.html#map-layout-tab">Map Layout Tab</a></li>
<li class="toctree-l2"><a class="reference internal" href="region-map-editor.html#map-entries-tab">Map Entries Tab</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tileset-editor.html">The Tileset Editor</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tileset-editor.html#metatile-properties">Metatile Properties</a><ul>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#layer-type">Layer Type</a></li>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#metatile-behavior">Metatile Behavior</a></li>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#encounter-type">Encounter Type</a></li>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#terrain-type">Terrain Type</a></li>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#metatile-label">Metatile Label</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="tileset-editor.html#tools-menu">Tools Menu</a><ul>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#import-tiles-image">Import Tiles Image…</a></li>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#import-metatiles-from-advance-map-1-92">Import Metatiles from Advance Map 1.92…</a></li>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#change-number-of-metatiles">Change Number of Metatiles</a></li>
<li class="toctree-l3"><a class="reference internal" href="tileset-editor.html#other-tools">Other Tools</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="tileset-editor.html#palette-editor">Palette Editor</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Scripting Capabilities</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#writing-a-custom-script">Writing a Custom Script</a></li>
<li class="toctree-l2"><a class="reference internal" href="#registering-script-actions">Registering Script Actions</a></li>
<li class="toctree-l2"><a class="reference internal" href="#scripting-api">Scripting API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#callbacks">Callbacks</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#onProjectOpened"><code class="docutils literal notranslate"><span class="pre">onProjectOpened</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onProjectClosed"><code class="docutils literal notranslate"><span class="pre">onProjectClosed</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onMapOpened"><code class="docutils literal notranslate"><span class="pre">onMapOpened</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onBlockChanged"><code class="docutils literal notranslate"><span class="pre">onBlockChanged</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onBorderMetatileChanged"><code class="docutils literal notranslate"><span class="pre">onBorderMetatileChanged</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onBlockHoverChanged"><code class="docutils literal notranslate"><span class="pre">onBlockHoverChanged</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onBlockHoverCleared"><code class="docutils literal notranslate"><span class="pre">onBlockHoverCleared</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onMapResized"><code class="docutils literal notranslate"><span class="pre">onMapResized</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onBorderResized"><code class="docutils literal notranslate"><span class="pre">onBorderResized</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onMapShifted"><code class="docutils literal notranslate"><span class="pre">onMapShifted</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onTilesetUpdated"><code class="docutils literal notranslate"><span class="pre">onTilesetUpdated</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onMainTabChanged"><code class="docutils literal notranslate"><span class="pre">onMainTabChanged</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onMapViewTabChanged"><code class="docutils literal notranslate"><span class="pre">onMapViewTabChanged</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#onBorderVisibilityToggled"><code class="docutils literal notranslate"><span class="pre">onBorderVisibilityToggled</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#functions">Functions</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#map-editing-functions">Map Editing Functions</a></li>
<li class="toctree-l4"><a class="reference internal" href="#map-header-editing-functions">Map Header Editing Functions</a></li>
<li class="toctree-l4"><a class="reference internal" href="#tileset-functions">Tileset Functions</a></li>
<li class="toctree-l4"><a class="reference internal" href="#overlay-functions">Overlay Functions</a></li>
<li class="toctree-l4"><a class="reference internal" href="#settings-functions">Settings Functions</a></li>
<li class="toctree-l4"><a class="reference internal" href="#utility-functions">Utility Functions</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#constants">Constants</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#constants.max_primary_tiles"><code class="docutils literal notranslate"><span class="pre">constants.max_primary_tiles</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.max_secondary_tiles"><code class="docutils literal notranslate"><span class="pre">constants.max_secondary_tiles</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.max_primary_metatiles"><code class="docutils literal notranslate"><span class="pre">constants.max_primary_metatiles</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.max_secondary_metatiles"><code class="docutils literal notranslate"><span class="pre">constants.max_secondary_metatiles</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.layers_per_metatile"><code class="docutils literal notranslate"><span class="pre">constants.layers_per_metatile</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.tiles_per_metatile"><code class="docutils literal notranslate"><span class="pre">constants.tiles_per_metatile</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.base_game_version"><code class="docutils literal notranslate"><span class="pre">constants.base_game_version</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.version.major"><code class="docutils literal notranslate"><span class="pre">constants.version.major</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.version.minor"><code class="docutils literal notranslate"><span class="pre">constants.version.minor</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#constants.version.patch"><code class="docutils literal notranslate"><span class="pre">constants.version.patch</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="project-files.html">Project Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="shortcuts.html">Shortcuts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="shortcuts.html#main-window">Main Window</a></li>
<li class="toctree-l2"><a class="reference internal" href="shortcuts.html#tileset-editor">Tileset Editor</a></li>
<li class="toctree-l2"><a class="reference internal" href="shortcuts.html#region-map-editor">Region Map Editor</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="settings-and-options.html">Porymap Settings</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../reference/changelog.html">Changelog</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#unreleased">Unreleased</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#changed">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#fixed">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id1">5.1.1 - 2023-02-20</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#added">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id2">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id3">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id4">5.1.0 - 2023-01-22</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id5">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id6">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id7">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id8">5.0.0 - 2022-10-30</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#breaking-changes">Breaking Changes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id9">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id10">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id11">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id12">4.5.0 - 2021-12-26</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id13">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id14">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id15">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id16">4.4.0 - 2020-12-20</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id17">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id18">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id19">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id20">4.3.1 - 2020-07-17</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id21">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id22">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id23">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id24">4.3.0 - 2020-06-27</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id25">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id26">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id27">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id28">4.2.0 - 2020-06-06</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id29">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id30">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id31">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id32">4.1.0 - 2020-05-18</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id33">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id34">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id35">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id36">4.0.0 - 2020-04-28</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id37">Breaking Changes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id38">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id39">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id40">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id41">3.0.1 - 2020-03-04</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id42">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id43">3.0.0 - 2020-03-04</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id44">Breaking Changes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id45">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id46">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id47">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id48">2.0.0 - 2019-10-16</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id49">Breaking Changes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id50">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id51">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id52">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id53">1.2.2 - 2019-05-16</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id54">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id55">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id56">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id57">1.2.1 - 2019-02-16</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id58">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id59">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id60">1.2.0 - 2019-02-04</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id61">Breaking Changes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id62">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id63">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id64">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id65">1.1.0 - 2018-12-27</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id66">Breaking Changes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id67">Added</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id68">Changed</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/changelog.html#id69">Fixed</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/changelog.html#id70">1.0.0 - 2018-10-26</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../reference/related-projects.html">Related Projects</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu"  style="background: linear-gradient(180deg, #08ACD5 50%, #FF6262 0%);" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">porymap</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">Scripting Capabilities</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/huderlem/porymap/blob/master/docsrc/manual/scripting-capabilities.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="scripting-capabilities">
<h1>Scripting Capabilities<a class="headerlink" href="#scripting-capabilities" title="Permalink to this heading"></a></h1>
<p>Porymap is extensible via scripting capabilities. This allows the user to write custom JavaScript (technically, ECMAScript) files to support enhanced workflows, without having to fork Porymap itself. While the possibilities are endless, some useful examples of scripting might be:</p>
<ul class="simple">
<li><p>Toggle Day/Night Palettes</p></li>
<li><p>Custom Map Painting Brushes</p></li>
<li><p>Detect Tile Errors</p></li>
<li><p>Show Diagonistic Information</p></li>
<li><p>Procedurally Generated Maps</p></li>
<li><p>Randomize Grass Patterns</p></li>
</ul>
<section id="writing-a-custom-script">
<h2>Writing a Custom Script<a class="headerlink" href="#writing-a-custom-script" title="Permalink to this heading"></a></h2>
<p>Let’s write a custom script that will randomize grass patterns when the user is editing the map. This is useful, since it’s cumbersome to manually add randomness to grass patches. With the custom script, it will happen automatically. Whenever the user paints a grass tile onto the map, the script will overwrite the tile with a random grass tile instead.</p>
<p>First, create a new script file called <code class="docutils literal notranslate"><span class="pre">my_script.js</span></code>–place it in the project directory (e.g. <code class="docutils literal notranslate"><span class="pre">pokefirered/</span></code>).</p>
<p>Next, open the Porymap project config file, <code class="docutils literal notranslate"><span class="pre">porymap.user.cfg</span></code>, in the project directory. Add the script file to the <code class="docutils literal notranslate"><span class="pre">custom_scripts</span></code> configuration value. Multiple script files can be loaded by separating the filepaths with a comma.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">custom_scripts</span><span class="o">=</span><span class="n">my_script</span><span class="o">.</span><span class="n">js</span>
</pre></div>
</div>
<p>Now that Porymap is configured to load the script file, let’s write the actual code that will power the grass-randomizer. Scripts have access to several “callbacks” for events that occur while Porymap is running. This means our script can define functions for each of these callbacks. We’re interested in the <code class="docutils literal notranslate"><span class="pre">onBlockChanged()</span></code> callback, since we want our script to take action whenever a user paints a block on the map.</p>
<div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="c1">// Porymap callback when a block is painted.</span>
<span class="k">export</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="nx">onBlockChanged</span><span class="p">(</span><span class="nx">x</span><span class="p">,</span><span class="w"> </span><span class="nx">y</span><span class="p">,</span><span class="w"> </span><span class="nx">prevBlock</span><span class="p">,</span><span class="w"> </span><span class="nx">newBlock</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="c1">// Grass-randomizing logic goes here.</span>
<span class="p">}</span>
</pre></div>
</div>
<p>It’s very <strong>important</strong> to remember to <code class="docutils literal notranslate"><span class="pre">export</span></code> the callback functions in the script. Otherwise, Porymap will not be able to execute them.</p>
<p>In addition to the callbacks, Porymap also supports a scripting API so that the script can interact with Porymap in interesting ways. For example, a script can change a block or add overlay text on the map. Since we want to paint random grass tiles, we’ll be using the <code class="docutils literal notranslate"><span class="pre">map.setMetatileId()</span></code> function. Let’s fill in the rest of the grass-randomizing code.</p>
<div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="kd">function</span><span class="w"> </span><span class="nx">randInt</span><span class="p">(</span><span class="nx">min</span><span class="p">,</span><span class="w"> </span><span class="nx">max</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="nx">min</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">min</span><span class="p">);</span>
<span class="w">    </span><span class="nx">max</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nx">max</span><span class="p">);</span>
<span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">random</span><span class="p">()</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="p">(</span><span class="nx">max</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="nx">min</span><span class="p">))</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">min</span><span class="p">;</span>
<span class="p">}</span>

<span class="c1">// These are the grass metatiles in pokefirered.</span>
<span class="kd">const</span><span class="w"> </span><span class="nx">grassTiles</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="mh">0x8</span><span class="p">,</span><span class="w"> </span><span class="mh">0x9</span><span class="p">,</span><span class="w"> </span><span class="mh">0x10</span><span class="p">,</span><span class="w"> </span><span class="mh">0x11</span><span class="p">];</span>

<span class="c1">// Porymap callback when a block is painted.</span>
<span class="k">export</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="nx">onBlockChanged</span><span class="p">(</span><span class="nx">x</span><span class="p">,</span><span class="w"> </span><span class="nx">y</span><span class="p">,</span><span class="w"> </span><span class="nx">prevBlock</span><span class="p">,</span><span class="w"> </span><span class="nx">newBlock</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="c1">// Check if the user is painting a grass tile.</span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nx">grassTiles</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">newBlock</span><span class="p">.</span><span class="nx">metatileId</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="o">-</span><span class="mf">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="c1">// Choose a random grass tile and paint it on the map.</span>
<span class="w">        </span><span class="kd">const</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">randInt</span><span class="p">(</span><span class="mf">0</span><span class="p">,</span><span class="w"> </span><span class="nx">grassTiles</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
<span class="w">        </span><span class="nx">map</span><span class="p">.</span><span class="nx">setMetatileId</span><span class="p">(</span><span class="nx">x</span><span class="p">,</span><span class="w"> </span><span class="nx">y</span><span class="p">,</span><span class="w"> </span><span class="nx">grassTiles</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
<span class="w">    </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Let’s test the script out by re-launching Porymap. If we try to paint grass on the map, we should see our script inserting a nice randomized grass pattern.</p>
<figure class="align-default" id="id22">
<img alt="Grass-Randomizing Script" src="../_images/porymap-scripting-grass.gif" />
<figcaption>
<p><span class="caption-text">Grass-Randomizing Script</span><a class="headerlink" href="#id22" title="Permalink to this image"></a></p>
</figcaption>
</figure>
</section>
<section id="registering-script-actions">
<h2>Registering Script Actions<a class="headerlink" href="#registering-script-actions" title="Permalink to this heading"></a></h2>
<p>The grass-randomizer script above happens implicitly when the user paints on the map. However, other times we probably want to call the custom script on demand. One of the API functions Porymap provides is the ability to trigger scripting functions from the <code class="docutils literal notranslate"><span class="pre">Tools</span></code> menu, or a keyboard shortcut. To do this, we will usually want to register the action when the project loads. Here is an example script where some custom actions are registered.</p>
<div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="k">export</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="nx">applyNightTint</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="c1">// Apply night palette tinting...</span>
<span class="p">}</span>

<span class="c1">// Porymap callback when project is opened.</span>
<span class="k">export</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="nx">onProjectOpened</span><span class="p">(</span><span class="nx">projectPath</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">   </span><span class="nx">utility</span><span class="p">.</span><span class="nx">registerAction</span><span class="p">(</span><span class="s2">&quot;applyNightTint&quot;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;View Night Tint&quot;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;T&quot;</span><span class="p">)</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Then, to trigger the <code class="docutils literal notranslate"><span class="pre">applyNightTint()</span></code> function, we could either click <code class="docutils literal notranslate"><span class="pre">Tools</span> <span class="pre">-&gt;</span> <span class="pre">View</span> <span class="pre">Night</span> <span class="pre">Tint</span></code> or use the <code class="docutils literal notranslate"><span class="pre">T</span></code> keyboard shortcut.</p>
<p>Now that we have an overview of how to utilize Porymap’s scripting capabilities, the entire scripting API is documented below.</p>
</section>
<section id="scripting-api">
<h2>Scripting API<a class="headerlink" href="#scripting-api" title="Permalink to this heading"></a></h2>
<section id="callbacks">
<h3>Callbacks<a class="headerlink" href="#callbacks" title="Permalink to this heading"></a></h3>
<dl class="js function">
<dt class="sig sig-object js" id="onProjectOpened">
<span class="sig-name descname"><span class="n"><span class="pre">onProjectOpened</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">projectPath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onProjectOpened" title="Permalink to this definition"></a></dt>
<dd><p>Called when Porymap successfully opens a project.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>projectPath</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the directory path of the opened project</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onProjectClosed">
<span class="sig-name descname"><span class="n"><span class="pre">onProjectClosed</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">projectPath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onProjectClosed" title="Permalink to this definition"></a></dt>
<dd><p>Called when Porymap closes a project. For example, this is called when opening a different project.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>projectPath</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the directory path of the closed project</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onMapOpened">
<span class="sig-name descname"><span class="n"><span class="pre">onMapOpened</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mapName</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onMapOpened" title="Permalink to this definition"></a></dt>
<dd><p>Called when a map is opened.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mapName</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the name of the opened map</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onBlockChanged">
<span class="sig-name descname"><span class="n"><span class="pre">onBlockChanged</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prevBlock</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newBlock</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onBlockChanged" title="Permalink to this definition"></a></dt>
<dd><p>Called when a block is changed on the map. For example, this is called when a user paints a new tile or changes the collision property of a block.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
<li><p><strong>prevBlock</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">object</span></code></span>) – the block’s state before it was modified. The object’s shape is <code class="docutils literal notranslate"><span class="pre">{metatileId,</span> <span class="pre">collision,</span> <span class="pre">elevation,</span> <span class="pre">rawValue}</span></code></p></li>
<li><p><strong>newBlock</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">object</span></code></span>) – the block’s new state after it was modified. The object’s shape is <code class="docutils literal notranslate"><span class="pre">{metatileId,</span> <span class="pre">collision,</span> <span class="pre">elevation,</span> <span class="pre">rawValue}</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onBorderMetatileChanged">
<span class="sig-name descname"><span class="n"><span class="pre">onBorderMetatileChanged</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prevMetatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newMetatileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onBorderMetatileChanged" title="Permalink to this definition"></a></dt>
<dd><p>Called when a border metatile is changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
<li><p><strong>prevMetatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the metatile id of the border block before it was modified</p></li>
<li><p><strong>newMetatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the metatile id of the border block after it was modified</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onBlockHoverChanged">
<span class="sig-name descname"><span class="n"><span class="pre">onBlockHoverChanged</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onBlockHoverChanged" title="Permalink to this definition"></a></dt>
<dd><p>Called when the mouse enters a new map block.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onBlockHoverCleared">
<span class="sig-name descname"><span class="n"><span class="pre">onBlockHoverCleared</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#onBlockHoverCleared" title="Permalink to this definition"></a></dt>
<dd><p>Called when the mouse exits the map.</p>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onMapResized">
<span class="sig-name descname"><span class="n"><span class="pre">onMapResized</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">oldWidth</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">oldHeight</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newWidth</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newHeight</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onMapResized" title="Permalink to this definition"></a></dt>
<dd><p>Called when the dimensions of the map are changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>oldWidth</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the width of the map before the change</p></li>
<li><p><strong>oldHeight</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the height of the map before the change</p></li>
<li><p><strong>newWidth</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the width of the map after the change</p></li>
<li><p><strong>newHeight</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the height of the map after the change</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onBorderResized">
<span class="sig-name descname"><span class="n"><span class="pre">onBorderResized</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">oldWidth</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">oldHeight</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newWidth</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newHeight</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onBorderResized" title="Permalink to this definition"></a></dt>
<dd><p>Called when the dimensions of the border are changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>oldWidth</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the width of the border before the change</p></li>
<li><p><strong>oldHeight</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the height of the border before the change</p></li>
<li><p><strong>newWidth</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the width of the border after the change</p></li>
<li><p><strong>newHeight</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the height of the border after the change</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onMapShifted">
<span class="sig-name descname"><span class="n"><span class="pre">onMapShifted</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xDelta</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yDelta</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onMapShifted" title="Permalink to this definition"></a></dt>
<dd><p>Called when the map is updated by use of the Map Shift tool.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xDelta</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the horizontal change from the shift</p></li>
<li><p><strong>yDelta</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the vertical change from the shift</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onTilesetUpdated">
<span class="sig-name descname"><span class="n"><span class="pre">onTilesetUpdated</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tilesetName</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onTilesetUpdated" title="Permalink to this definition"></a></dt>
<dd><p>Called when the currently loaded tileset is changed by switching to a new one or by saving changes to it in the Tileset Editor.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tilesetName</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the name of the updated tileset</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onMainTabChanged">
<span class="sig-name descname"><span class="n"><span class="pre">onMainTabChanged</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">oldTab</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newTab</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onMainTabChanged" title="Permalink to this definition"></a></dt>
<dd><p>Called when the selected tab in the main tab bar is changed. Tabs are indexed from left to right, starting at 0 (<code class="docutils literal notranslate"><span class="pre">0</span></code>: Map, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Events, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Header, <code class="docutils literal notranslate"><span class="pre">3</span></code>: Connections, <code class="docutils literal notranslate"><span class="pre">4</span></code>: Wild Pokemon).</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>oldTab</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the index of the previously selected tab</p></li>
<li><p><strong>newTab</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the index of the newly selected tab</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onMapViewTabChanged">
<span class="sig-name descname"><span class="n"><span class="pre">onMapViewTabChanged</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">oldTab</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newTab</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onMapViewTabChanged" title="Permalink to this definition"></a></dt>
<dd><p>Called when the selected tab in the map view tab bar is changed. Tabs are indexed from left to right, starting at 0 (<code class="docutils literal notranslate"><span class="pre">0</span></code>: Metatiles, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Collision, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Prefabs).</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>oldTab</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the index of the previously selected tab</p></li>
<li><p><strong>newTab</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the index of the newly selected tab</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="onBorderVisibilityToggled">
<span class="sig-name descname"><span class="n"><span class="pre">onBorderVisibilityToggled</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">visible</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#onBorderVisibilityToggled" title="Permalink to this definition"></a></dt>
<dd><p>Called when the visibility of the border and connecting maps is toggled on or off.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>visible</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the border is now visible</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
<section id="functions">
<h3>Functions<a class="headerlink" href="#functions" title="Permalink to this heading"></a></h3>
<section id="map-editing-functions">
<h4>Map Editing Functions<a class="headerlink" href="#map-editing-functions" title="Permalink to this heading"></a></h4>
<p>The following functions are related to editing the map’s blocks or retrieving information about them.</p>
<p>All map editing functions are callable via the global <code class="docutils literal notranslate"><span class="pre">map</span></code> object.</p>
<dl class="js function">
<dt class="sig sig-object js" id="map.getBlock">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getBlock</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getBlock" title="Permalink to this definition"></a></dt>
<dd><p>Gets a block in the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the block object</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object (<code class="docutils literal notranslate"><span class="pre">{metatileId,</span> <span class="pre">collision,</span> <span class="pre">elevation,</span> <span class="pre">rawValue}</span></code>)</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setBlock">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBlock</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">collision</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">elevation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setBlock" title="Permalink to this definition"></a></dt>
<dd><p>Sets a block in the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the metatile id of the block</p></li>
<li><p><strong>collision</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the collision of the block (<code class="docutils literal notranslate"><span class="pre">0</span></code> = passable, <code class="docutils literal notranslate"><span class="pre">1-3</span></code> = impassable)</p></li>
<li><p><strong>elevation</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the elevation of the block</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id0">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBlock</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rawValue</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id0" title="Permalink to this definition"></a></dt>
<dd><p>Sets a block in the currently-opened map. This is an overloaded function that takes the raw value of a block instead of each of the block’s properties individually.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
<li><p><strong>rawValue</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the 16 bit value of the block. Bits <code class="docutils literal notranslate"><span class="pre">0-9</span></code> will be the metatile id, bits <code class="docutils literal notranslate"><span class="pre">10-11</span></code> will be the collision, and bits <code class="docutils literal notranslate"><span class="pre">12-15</span></code> will be the elevation.</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileId">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileId</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileId" title="Permalink to this definition"></a></dt>
<dd><p>Gets the metatile id of a block in the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the metatile id of the block</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileId">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileId</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileId" title="Permalink to this definition"></a></dt>
<dd><p>Sets the metatile id of a block in the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the metatile id of the block</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getBorderMetatileId">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getBorderMetatileId</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getBorderMetatileId" title="Permalink to this definition"></a></dt>
<dd><p>Gets the metatile id of a block in the border of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the metatile id of the block</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setBorderMetatileId">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBorderMetatileId</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setBorderMetatileId" title="Permalink to this definition"></a></dt>
<dd><p>Sets the metatile id of a block in the border of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the metatile id of the block</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getCollision">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getCollision</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getCollision" title="Permalink to this definition"></a></dt>
<dd><p>Gets the collision of a block in the currently-opened map. (<code class="docutils literal notranslate"><span class="pre">0</span></code> = passable, <code class="docutils literal notranslate"><span class="pre">1-3</span></code> = impassable)</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the collision of the block</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setCollision">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setCollision</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">collision</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setCollision" title="Permalink to this definition"></a></dt>
<dd><p>Sets the collision of a block in the currently-opened map. (<code class="docutils literal notranslate"><span class="pre">0</span></code> = passable, <code class="docutils literal notranslate"><span class="pre">1-3</span></code> = impassable)</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
<li><p><strong>collision</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the collision of the block</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getElevation">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElevation</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getElevation" title="Permalink to this definition"></a></dt>
<dd><p>Gets the elevation of a block in the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the elevation of the block</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setElevation">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setElevation</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">elevation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setElevation" title="Permalink to this definition"></a></dt>
<dd><p>Sets the elevation of a block in the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – x coordinate of the block</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – y coordinate of the block</p></li>
<li><p><strong>elevation</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the elevation of the block</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setBlocksFromSelection">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBlocksFromSelection</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setBlocksFromSelection" title="Permalink to this definition"></a></dt>
<dd><p>Sets blocks on the map using the user’s current metatile selection.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial x coordinate</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial y coordinate</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.bucketFill">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">bucketFill</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.bucketFill" title="Permalink to this definition"></a></dt>
<dd><p>Performs a bucket fill of a metatile id, starting at the given coordinates.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial x coordinate</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial y coordinate</p></li>
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – metatile id to fill</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.bucketFillFromSelection">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">bucketFillFromSelection</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.bucketFillFromSelection" title="Permalink to this definition"></a></dt>
<dd><p>Performs a bucket fill using the user’s current metatile selection, starting at the given coordinates.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial x coordinate</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial y coordinate</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.magicFill">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">magicFill</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.magicFill" title="Permalink to this definition"></a></dt>
<dd><p>Performs a magic fill of a metatile id, starting at the given coordinates.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial x coordinate</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial y coordinate</p></li>
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – metatile id to magic fill</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.magicFillFromSelection">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">magicFillFromSelection</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.magicFillFromSelection" title="Permalink to this definition"></a></dt>
<dd><p>Performs a magic fill using the user’s current metatile selection, starting at the given coordinates.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial x coordinate</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – initial y coordinate</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.shift">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">shift</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xDelta</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yDelta</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.shift" title="Permalink to this definition"></a></dt>
<dd><p>Performs a shift on the map’s blocks.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xDelta</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – number of blocks to shift horizontally</p></li>
<li><p><strong>yDelta</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – number of blocks to shift vertically</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
<li><p><strong>commitChanges</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Commit the changes to the map’s edit/undo history. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. When making many related map edits, it can be useful to set this to <code class="docutils literal notranslate"><span class="pre">false</span></code>, and then commit all of them together with <code class="docutils literal notranslate"><span class="pre">map.commit()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getDimensions">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getDimensions</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getDimensions" title="Permalink to this definition"></a></dt>
<dd><p>Gets the dimensions of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the dimensions of the map</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>object (<code class="docutils literal notranslate"><span class="pre">{width,</span> <span class="pre">height}</span></code>)</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getWidth">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getWidth</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getWidth" title="Permalink to this definition"></a></dt>
<dd><p>Gets the width of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the width of the map</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getHeight">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getHeight</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getHeight" title="Permalink to this definition"></a></dt>
<dd><p>Gets the height of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the height of the map</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getBorderDimensions">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getBorderDimensions</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getBorderDimensions" title="Permalink to this definition"></a></dt>
<dd><p>Gets the dimensions of the border of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the dimensions of the border</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>object (<code class="docutils literal notranslate"><span class="pre">{width,</span> <span class="pre">height}</span></code>)</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getBorderWidth">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getBorderWidth</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getBorderWidth" title="Permalink to this definition"></a></dt>
<dd><p>Gets the width of the border of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the width of the border</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getBorderHeight">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getBorderHeight</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getBorderHeight" title="Permalink to this definition"></a></dt>
<dd><p>Gets the height of the border of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the height of the border</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setDimensions">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setDimensions</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setDimensions" title="Permalink to this definition"></a></dt>
<dd><p>Sets the dimensions of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>width</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – width in blocks</p></li>
<li><p><strong>height</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – height in blocks</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setWidth">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setWidth</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">width</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setWidth" title="Permalink to this definition"></a></dt>
<dd><p>Sets the width of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>width</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – width in blocks</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setHeight">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setHeight</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.setHeight" title="Permalink to this definition"></a></dt>
<dd><p>Sets the height of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>height</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – height in blocks</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setBorderDimensions">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBorderDimensions</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setBorderDimensions" title="Permalink to this definition"></a></dt>
<dd><p>Sets the dimensions of the border of the currently-opened map. If the config setting <code class="docutils literal notranslate"><span class="pre">use_custom_border_size</span></code> is set to <code class="docutils literal notranslate"><span class="pre">0</span></code> then this does nothing.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>width</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – width in blocks</p></li>
<li><p><strong>height</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – height in blocks</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setBorderWidth">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBorderWidth</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">width</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setBorderWidth" title="Permalink to this definition"></a></dt>
<dd><p>Sets the width of the border of the currently-opened map. If the config setting <code class="docutils literal notranslate"><span class="pre">use_custom_border_size</span></code> is set to <code class="docutils literal notranslate"><span class="pre">0</span></code> then this does nothing.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>width</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – width in blocks</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setBorderHeight">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBorderHeight</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">height</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setBorderHeight" title="Permalink to this definition"></a></dt>
<dd><p>Sets the height of the border of the currently-opened map. If the config setting <code class="docutils literal notranslate"><span class="pre">use_custom_border_size</span></code> is set to <code class="docutils literal notranslate"><span class="pre">0</span></code> then this does nothing.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>height</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – height in blocks</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.redraw">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">redraw</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.redraw" title="Permalink to this definition"></a></dt>
<dd><p>Redraws the entire map area. Useful when delaying map redraws using <code class="docutils literal notranslate"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">false</span></code> in certain map editing functions.</p>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.commit">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">commit</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.commit" title="Permalink to this definition"></a></dt>
<dd><p>Commits any uncommitted changes to the map’s edit/undo history. Useful when delaying commits using <code class="docutils literal notranslate"><span class="pre">commitChanges</span> <span class="pre">=</span> <span class="pre">false</span></code> in certain map editing functions.</p>
</dd></dl>

</section>
<section id="map-header-editing-functions">
<h4>Map Header Editing Functions<a class="headerlink" href="#map-header-editing-functions" title="Permalink to this heading"></a></h4>
<p>The following functions are related to reading/writing the map’s header properties.</p>
<p>All map header functions are callable via the global <code class="docutils literal notranslate"><span class="pre">map</span></code> object.</p>
<dl class="js function">
<dt class="sig sig-object js" id="map.getSong">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSong</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getSong" title="Permalink to this definition"></a></dt>
<dd><p>Gets the name of the background song for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the name of the song</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>string</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setSong">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setSong</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">song</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setSong" title="Permalink to this definition"></a></dt>
<dd><p>Sets the name of the background song for the currently-opened map. The song name must be one of the names in the “Song” dropdown menu on the Header tab.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>song</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the name of the song</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getLocation">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getLocation</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getLocation" title="Permalink to this definition"></a></dt>
<dd><p>Gets the name of the region map location for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the name of the location</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>string</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setLocation">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setLocation</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">location</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setLocation" title="Permalink to this definition"></a></dt>
<dd><p>Sets the name of the region map location for the currently-opened map. The location name must be one of the names in the “Location” dropdown menu on the Header tab.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>location</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the name of the location</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getRequiresFlash">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getRequiresFlash</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getRequiresFlash" title="Permalink to this definition"></a></dt>
<dd><p>Gets whether flash would be required in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>whether flash is required</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setRequiresFlash">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setRequiresFlash</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">require</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setRequiresFlash" title="Permalink to this definition"></a></dt>
<dd><p>Sets whether flash would be required in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>require</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether flash should be required</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getWeather">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getWeather</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getWeather" title="Permalink to this definition"></a></dt>
<dd><p>Gets the name of the weather for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the name of the weather</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>string</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setWeather">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setWeather</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">weather</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setWeather" title="Permalink to this definition"></a></dt>
<dd><p>Sets the name of the weather for the currently-opened map. The weather name must be one of the names in the “Weather” dropdown menu on the Header tab.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>weather</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the name of the weather</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getType">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getType</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getType" title="Permalink to this definition"></a></dt>
<dd><p>Gets the name of the map type for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the name of the map type</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>string</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setType">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setType</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">type</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setType" title="Permalink to this definition"></a></dt>
<dd><p>Sets the name of the map type for the currently-opened map. The map type name must be one of the names in the “Type” dropdown menu on the Header tab.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>type</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the name of the map type</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getBattleScene">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getBattleScene</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getBattleScene" title="Permalink to this definition"></a></dt>
<dd><p>Gets the name of the battle scene for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the name of the battle scene</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>string</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setBattleScene">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBattleScene</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">battleScene</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setBattleScene" title="Permalink to this definition"></a></dt>
<dd><p>Sets the name of the battle scene for the currently-opened map. The battle scene name must be one of the names in the “Battle scene” dropdown menu on the Header tab.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>battleScene</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the name of the battle scene</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getShowLocationName">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getShowLocationName</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getShowLocationName" title="Permalink to this definition"></a></dt>
<dd><p>Gets whether the location name will appear in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>whether the location name will be shown</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setShowLocationName">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setShowLocationName</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">show</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setShowLocationName" title="Permalink to this definition"></a></dt>
<dd><p>Sets whether the location name should appear in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>show</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the location name should be shown</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getAllowRunning">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getAllowRunning</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getAllowRunning" title="Permalink to this definition"></a></dt>
<dd><p>Gets whether running is allowed in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>whether running is allowed</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setAllowRunning">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setAllowRunning</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">allow</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setAllowRunning" title="Permalink to this definition"></a></dt>
<dd><p>Sets whether running should be allowed in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>allow</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether running should be allowed</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getAllowBiking">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getAllowBiking</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getAllowBiking" title="Permalink to this definition"></a></dt>
<dd><p>Gets whether biking is allowed in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>whether biking is allowed</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setAllowBiking">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setAllowBiking</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">allow</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setAllowBiking" title="Permalink to this definition"></a></dt>
<dd><p>Sets whether biking should be allowed in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>allow</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether biking should be allowed</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getAllowEscaping">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getAllowEscaping</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getAllowEscaping" title="Permalink to this definition"></a></dt>
<dd><p>Gets whether escaping (using Escape Rope or Dig) is allowed in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>whether escaping is allowed</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setAllowEscaping">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setAllowEscaping</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">allow</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setAllowEscaping" title="Permalink to this definition"></a></dt>
<dd><p>Sets whether escaping (using Escape Rope or Dig) should be allowed in-game for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>allow</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether escaping should be allowed</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getFloorNumber">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getFloorNumber</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getFloorNumber" title="Permalink to this definition"></a></dt>
<dd><p>Gets the floor number for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the floor number</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setFloorNumber">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setFloorNumber</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">floorNumber</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setFloorNumber" title="Permalink to this definition"></a></dt>
<dd><p>Sets the floor number for the currently-opened map. Floor numbers can be any number between -128 and 127 inclusive.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>floorNumber</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the floor number</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
<section id="tileset-functions">
<h4>Tileset Functions<a class="headerlink" href="#tileset-functions" title="Permalink to this heading"></a></h4>
<p>The following functions are related to tilesets and how they are rendered. The functions with “preview” in their name operate on a “fake” version of the palette colors. This means that changing these “preview” colors won’t affect the actual tileset colors in the project. A good use of the “preview” palettes would be Day/Night tints, for example.</p>
<p>All tileset functions are callable via the global <code class="docutils literal notranslate"><span class="pre">map</span></code> object.</p>
<dl class="js function">
<dt class="sig sig-object js" id="map.getPrimaryTileset">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getPrimaryTileset</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getPrimaryTileset" title="Permalink to this definition"></a></dt>
<dd><p>Gets the name of the primary tileset for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>primary tileset name</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>string</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setPrimaryTileset">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setPrimaryTileset</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tileset</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setPrimaryTileset" title="Permalink to this definition"></a></dt>
<dd><p>Sets the primary tileset for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tileset</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the tileset name</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getSecondaryTileset">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSecondaryTileset</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getSecondaryTileset" title="Permalink to this definition"></a></dt>
<dd><p>Gets the name of the secondary tileset for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>secondary tileset name</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>string</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setSecondaryTileset">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setSecondaryTileset</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tileset</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setSecondaryTileset" title="Permalink to this definition"></a></dt>
<dd><p>Sets the secondary tileset for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tileset</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the tileset name</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getNumPrimaryTilesetTiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getNumPrimaryTilesetTiles</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getNumPrimaryTilesetTiles" title="Permalink to this definition"></a></dt>
<dd><p>Gets the number of tiles in the primary tileset for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>number of tiles</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getNumSecondaryTilesetTiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getNumSecondaryTilesetTiles</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getNumSecondaryTilesetTiles" title="Permalink to this definition"></a></dt>
<dd><p>Gets the number of tiles in the secondary tileset for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>number of tiles</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getNumPrimaryTilesetMetatiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getNumPrimaryTilesetMetatiles</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getNumPrimaryTilesetMetatiles" title="Permalink to this definition"></a></dt>
<dd><p>Gets the number of metatiles in the primary tileset for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>number of metatiles</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getNumSecondaryTilesetMetatiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getNumSecondaryTilesetMetatiles</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getNumSecondaryTilesetMetatiles" title="Permalink to this definition"></a></dt>
<dd><p>Gets the number of metatiles in the secondary tileset for the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>number of metatiles</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getPrimaryTilesetPalettePreview">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getPrimaryTilesetPalettePreview</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paletteIndex</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getPrimaryTilesetPalettePreview" title="Permalink to this definition"></a></dt>
<dd><p>Gets a palette from the primary tileset of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paletteIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the palette index</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>array of colors. Each color is a 3-element RGB array</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setPrimaryTilesetPalettePreview">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setPrimaryTilesetPalettePreview</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paletteIndex</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">colors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setPrimaryTilesetPalettePreview" title="Permalink to this definition"></a></dt>
<dd><p>Sets a palette in the primary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paletteIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the palette index</p></li>
<li><p><strong>colors</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of colors. Each color is a 3-element RGB array</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Redraw the elements with the updated palette. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <code class="docutils literal notranslate"><span class="pre">redraw</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> on the final call.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getPrimaryTilesetPalettesPreview">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getPrimaryTilesetPalettesPreview</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getPrimaryTilesetPalettesPreview" title="Permalink to this definition"></a></dt>
<dd><p>Gets all of the palettes from the primary tileset of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>array of arrays of colors. Each color is a 3-element RGB array</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setPrimaryTilesetPalettesPreview">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setPrimaryTilesetPalettesPreview</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">palettes</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setPrimaryTilesetPalettesPreview" title="Permalink to this definition"></a></dt>
<dd><p>Sets all of the palettes in the primary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>palettes</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of arrays of colors. Each color is a 3-element RGB array</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Redraw the elements with the updated palettes. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <code class="docutils literal notranslate"><span class="pre">redraw</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> on the final call.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getSecondaryTilesetPalettePreview">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSecondaryTilesetPalettePreview</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paletteIndex</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getSecondaryTilesetPalettePreview" title="Permalink to this definition"></a></dt>
<dd><p>Gets a palette from the secondary tileset of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paletteIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the palette index</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>array of colors. Each color is a 3-element RGB array</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setSecondaryTilesetPalettePreview">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setSecondaryTilesetPalettePreview</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paletteIndex</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">colors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setSecondaryTilesetPalettePreview" title="Permalink to this definition"></a></dt>
<dd><p>Sets a palette in the secondary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paletteIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the palette index</p></li>
<li><p><strong>colors</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of colors. Each color is a 3-element RGB array</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Redraw the elements with the updated palette. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <code class="docutils literal notranslate"><span class="pre">redraw</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> on the final call.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getSecondaryTilesetPalettesPreview">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSecondaryTilesetPalettesPreview</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getSecondaryTilesetPalettesPreview" title="Permalink to this definition"></a></dt>
<dd><p>Gets all of the palettes from the secondary tileset of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>array of arrays of colors. Each color is a 3-element RGB array</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setSecondaryTilesetPalettesPreview">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setSecondaryTilesetPalettesPreview</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">palettes</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setSecondaryTilesetPalettesPreview" title="Permalink to this definition"></a></dt>
<dd><p>Sets all of the palettes in the secondary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>palettes</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of arrays of colors. Each color is a 3-element RGB array</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Redraw the elements with the updated palettes. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <code class="docutils literal notranslate"><span class="pre">redraw</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> on the final call.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getPrimaryTilesetPalette">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getPrimaryTilesetPalette</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paletteIndex</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getPrimaryTilesetPalette" title="Permalink to this definition"></a></dt>
<dd><p>Gets a palette from the primary tileset of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paletteIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the palette index</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>array of colors. Each color is a 3-element RGB array</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setPrimaryTilesetPalette">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setPrimaryTilesetPalette</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paletteIndex</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">colors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setPrimaryTilesetPalette" title="Permalink to this definition"></a></dt>
<dd><p>Sets a palette in the primary tileset of the currently-opened map. This will permanently affect the palette and save the palette to disk.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paletteIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the palette index</p></li>
<li><p><strong>colors</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of colors. Each color is a 3-element RGB array</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Redraw the elements with the updated palette. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <code class="docutils literal notranslate"><span class="pre">redraw</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> on the final call.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getPrimaryTilesetPalettes">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getPrimaryTilesetPalettes</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getPrimaryTilesetPalettes" title="Permalink to this definition"></a></dt>
<dd><p>Gets all of the palettes from the primary tileset of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>array of arrays of colors. Each color is a 3-element RGB array</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setPrimaryTilesetPalettes">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setPrimaryTilesetPalettes</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">palettes</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setPrimaryTilesetPalettes" title="Permalink to this definition"></a></dt>
<dd><p>Sets all of the palettes in the primary tileset of the currently-opened map. This will permanently affect the palettes and save the palettes to disk.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>palettes</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of arrays of colors. Each color is a 3-element RGB array</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Redraw the elements with the updated palettes. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <code class="docutils literal notranslate"><span class="pre">redraw</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> on the final call.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getSecondaryTilesetPalette">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSecondaryTilesetPalette</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paletteIndex</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getSecondaryTilesetPalette" title="Permalink to this definition"></a></dt>
<dd><p>Gets a palette from the secondary tileset of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paletteIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the palette index</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>array of colors. Each color is a 3-element RGB array</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setSecondaryTilesetPalette">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setSecondaryTilesetPalette</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paletteIndex</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">colors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setSecondaryTilesetPalette" title="Permalink to this definition"></a></dt>
<dd><p>Sets a palette in the secondary tileset of the currently-opened map. This will permanently affect the palette and save the palette to disk.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paletteIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the palette index</p></li>
<li><p><strong>colors</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of colors. Each color is a 3-element RGB array</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Redraw the elements with the updated palette. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <code class="docutils literal notranslate"><span class="pre">redraw</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> on the final call.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getSecondaryTilesetPalettes">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSecondaryTilesetPalettes</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#map.getSecondaryTilesetPalettes" title="Permalink to this definition"></a></dt>
<dd><p>Gets all of the palettes from the secondary tileset of the currently-opened map.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>array of arrays of colors. Each color is a 3-element RGB array</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setSecondaryTilesetPalettes">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setSecondaryTilesetPalettes</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">palettes</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setSecondaryTilesetPalettes" title="Permalink to this definition"></a></dt>
<dd><p>Sets all of the palettes in the secondary tileset of the currently-opened map. This will permanently affect the palettes and save the palettes to disk.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>palettes</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of arrays of colors. Each color is a 3-element RGB array</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Redraw the elements with the updated palettes. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set <code class="docutils literal notranslate"><span class="pre">redraw</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> on the final call.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileLabel">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileLabel</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileLabel" title="Permalink to this definition"></a></dt>
<dd><p>Gets the label for the specified metatile.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the label</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>string</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileLabel">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileLabel</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileLabel" title="Permalink to this definition"></a></dt>
<dd><p>Sets the label for the specified metatile. A label can only consist of letters, numbers, and underscores.</p>
<p><strong>Warning:</strong> This function writes directly to the project. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>label</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the label</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileLayerType">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileLayerType</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileLayerType" title="Permalink to this definition"></a></dt>
<dd><p>Gets the layer type for the specified metatile. <code class="docutils literal notranslate"><span class="pre">0</span></code>: Middle/Top, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Bottom/Middle, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Bottom/Top.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the layer type</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileLayerType">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileLayerType</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layerType</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileLayerType" title="Permalink to this definition"></a></dt>
<dd><p>Sets the layer type for the specified metatile. <code class="docutils literal notranslate"><span class="pre">0</span></code>: Middle/Top, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Bottom/Middle, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Bottom/Top.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>layerType</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer type</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileEncounterType">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileEncounterType</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileEncounterType" title="Permalink to this definition"></a></dt>
<dd><p>Gets the encounter type for the specified metatile. <code class="docutils literal notranslate"><span class="pre">0</span></code>: None, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Land, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Water</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the encounter type</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileEncounterType">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileEncounterType</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">encounterType</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileEncounterType" title="Permalink to this definition"></a></dt>
<dd><p>Sets the encounter type for the specified metatile. <code class="docutils literal notranslate"><span class="pre">0</span></code>: None, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Land, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Water</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>encounterType</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the encounter type</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileTerrainType">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileTerrainType</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileTerrainType" title="Permalink to this definition"></a></dt>
<dd><p>Gets the terrain type for the specified metatile. <code class="docutils literal notranslate"><span class="pre">0</span></code>: None, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Grass, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Water, <code class="docutils literal notranslate"><span class="pre">3</span></code>: Waterfall</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the terrain type</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileTerrainType">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileTerrainType</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">terrainType</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileTerrainType" title="Permalink to this definition"></a></dt>
<dd><p>Sets the terrain type for the specified metatile. <code class="docutils literal notranslate"><span class="pre">0</span></code>: None, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Grass, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Water, <code class="docutils literal notranslate"><span class="pre">3</span></code>: Waterfall</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>terrainType</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the terrain type</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileBehavior">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileBehavior</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileBehavior" title="Permalink to this definition"></a></dt>
<dd><p>Gets the behavior for the specified metatile.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the behavior</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileBehavior">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileBehavior</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">behavior</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileBehavior" title="Permalink to this definition"></a></dt>
<dd><p>Sets the behavior for the specified metatile.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>behavior</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the behavior</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileAttributes">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileAttributes</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileAttributes" title="Permalink to this definition"></a></dt>
<dd><p>Gets the raw attributes value for the specified metatile.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the raw attributes value</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileAttributes">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileAttributes</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attributes</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileAttributes" title="Permalink to this definition"></a></dt>
<dd><p>Sets the raw attributes value for the specified metatile.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this. Porymap will not limit the value of existing attributes to their usual range.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>attributes</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the raw attributes value</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileTile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileTile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileIndex</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileTile" title="Permalink to this definition"></a></dt>
<dd><p>Gets the tile at the specified index of the metatile.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>tileIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the tile to get</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the tile</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object (<code class="docutils literal notranslate"><span class="pre">{tileId,</span> <span class="pre">xflip,</span> <span class="pre">yflip,</span> <span class="pre">palette}</span></code>)</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getMetatileTiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileTiles</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileStart</span> <span class="pre">=</span> <span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileEnd</span> <span class="pre">=</span> <span class="pre">-1</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getMetatileTiles" title="Permalink to this definition"></a></dt>
<dd><p>Gets the tiles in the specified range of the metatile.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>tileStart</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the first tile to get. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code> (the first tile)</p></li>
<li><p><strong>tileEnd</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the last tile to get. Defaults to <code class="docutils literal notranslate"><span class="pre">-1</span></code> (the last tile)</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>array of tiles in the specified range. Each tile is an object of the form <code class="docutils literal notranslate"><span class="pre">{tileId,</span> <span class="pre">xflip,</span> <span class="pre">yflip,</span> <span class="pre">palette}</span></code></p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileTile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileTile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileIndex</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xflip</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yflip</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">palette</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileTile" title="Permalink to this definition"></a></dt>
<dd><p>Sets the tile at the specified index of the metatile.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>tileIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the tile to set</p></li>
<li><p><strong>tileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – new tile’s value</p></li>
<li><p><strong>xflip</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the new tile is flipped horizontally</p></li>
<li><p><strong>yflip</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the new tile is flipped vertically</p></li>
<li><p><strong>palette</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – new tile’s palette number</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id1">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileTile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileIndex</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id1" title="Permalink to this definition"></a></dt>
<dd><p>Sets the tile at the specified index of the metatile. This is an overloaded function that takes a single tile as a JavaScript object instead of each of the tile’s properties individually.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>tileIndex</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the tile to set</p></li>
<li><p><strong>tile</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">object</span></code></span>) – the new tile. <code class="docutils literal notranslate"><span class="pre">tile</span></code> is an object with the properties <code class="docutils literal notranslate"><span class="pre">{tileId,</span> <span class="pre">xflip,</span> <span class="pre">yflip,</span> <span class="pre">palette}</span></code></p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.setMetatileTiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileTiles</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xflip</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yflip</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">palette</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileStart</span> <span class="pre">=</span> <span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileEnd</span> <span class="pre">=</span> <span class="pre">-1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.setMetatileTiles" title="Permalink to this definition"></a></dt>
<dd><p>Sets the tiles in the specified range of the metatile. All tiles in the specified range will be set using the same given values.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>tileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – new tiles’ value</p></li>
<li><p><strong>xflip</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the new tiles are flipped horizontally</p></li>
<li><p><strong>yflip</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the new tiles are flipped vertically</p></li>
<li><p><strong>palette</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – new tiles’ palette number</p></li>
<li><p><strong>tileStart</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the first tile to set. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code> (the first tile)</p></li>
<li><p><strong>tileEnd</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the last tile to set. Defaults to <code class="docutils literal notranslate"><span class="pre">-1</span></code> (the last tile)</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id2">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileTiles</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tiles</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileStart</span> <span class="pre">=</span> <span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileEnd</span> <span class="pre">=</span> <span class="pre">-1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">forceRedraw</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id2" title="Permalink to this definition"></a></dt>
<dd><p>Sets the tiles in the specified range of the metatile. This is an overloaded function that takes an array of tiles as JavaScript objects instead of each of the tile properties individually.</p>
<p><strong>Warning:</strong> This function writes directly to the tileset. There is no undo for this.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of target metatile</p></li>
<li><p><strong>tiles</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of tiles to set. Each tile is an object of the form <code class="docutils literal notranslate"><span class="pre">{tileId,</span> <span class="pre">xflip,</span> <span class="pre">yflip,</span> <span class="pre">palette}</span></code>. If the array does not have sufficient objects to set all the tiles in the specified range then the remaining tiles will be set with all default values.</p></li>
<li><p><strong>tileStart</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the first tile to set. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code> (the first tile)</p></li>
<li><p><strong>tileEnd</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the last tile to set. Defaults to <code class="docutils literal notranslate"><span class="pre">-1</span></code> (the last tile)</p></li>
<li><p><strong>forceRedraw</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – Force the map view to refresh. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Redrawing the map view is expensive, so set to <code class="docutils literal notranslate"><span class="pre">false</span></code> when making many consecutive map edits, and then redraw the map once using <code class="docutils literal notranslate"><span class="pre">map.redraw()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="map.getTilePixels">
<span class="sig-prename descclassname"><span class="n"><span class="pre">map</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getTilePixels</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#map.getTilePixels" title="Permalink to this definition"></a></dt>
<dd><p>Gets the pixel data for the specified tile. The pixel data is an array of indexes indicating which palette color each pixel uses. Tiles are 8x8, so the pixel array will be 64 elements long.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the pixel data</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="overlay-functions">
<h4>Overlay Functions<a class="headerlink" href="#overlay-functions" title="Permalink to this heading"></a></h4>
<p>The following functions are related to an overlay that is drawn on top of the map area. Text, images, and shapes can be drawn using these functions. Items can be drawn and manipulated on separate layers by specifiying a layer id. Items on higher layer ids will be drawn above those on lower layers. The visibility, opacity, position, rotation, and scale of each layer can be changed; by default all layers are visible, have an opacity of <code class="docutils literal notranslate"><span class="pre">100</span></code>, are at position <code class="docutils literal notranslate"><span class="pre">0,0</span></code>, an angle of <code class="docutils literal notranslate"><span class="pre">0</span></code>, and a horizontal and vertical scale of <code class="docutils literal notranslate"><span class="pre">1.0</span></code>.</p>
<p>All overlay functions are callable via the global <code class="docutils literal notranslate"><span class="pre">overlay</span></code> object.</p>
<dl class="js function">
<dt class="sig sig-object js" id="overlay.clear">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clear</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.clear" title="Permalink to this definition"></a></dt>
<dd><p>Clears and erases all previously-added overlay items on the specified layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id3">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clear</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id3" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Clears and erases all previously-added overlay items on every layer.</p>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.hide">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">hide</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.hide" title="Permalink to this definition"></a></dt>
<dd><p>Hides all overlay items on the specified layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id4">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">hide</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id4" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Hides all overlay items on all active layers. Layers that have not been used yet will not be hidden.</p>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.show">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">show</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.show" title="Permalink to this definition"></a></dt>
<dd><p>Shows all overlay items on the specified layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id5">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">show</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id5" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Shows all overlay items on all active layers.</p>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.getVisibility">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getVisibility</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.getVisibility" title="Permalink to this definition"></a></dt>
<dd><p>Gets whether the specified overlay layer is currently showing or not.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>whether the layer is showing</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setVisibility">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setVisibility</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">visible</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setVisibility" title="Permalink to this definition"></a></dt>
<dd><p>Sets the visibility of the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>visible</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the layer should be showing</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id6">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setVisibility</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">visible</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id6" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the visibility of all active overlay layers.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>visible</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the layers should be showing</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.getOpacity">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getOpacity</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.getOpacity" title="Permalink to this definition"></a></dt>
<dd><p>Gets the opacity of the specified overlay layer. Opacity ranges from <code class="docutils literal notranslate"><span class="pre">0</span></code> (invisible) to <code class="docutils literal notranslate"><span class="pre">100</span></code> (completely opaque).</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the opacity</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setOpacity">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setOpacity</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opacity</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setOpacity" title="Permalink to this definition"></a></dt>
<dd><p>Sets the opacity of the specified overlay layer. Opacity ranges from <code class="docutils literal notranslate"><span class="pre">0</span></code> (invisible) to <code class="docutils literal notranslate"><span class="pre">100</span></code> (completely opaque).</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opacity</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the opacity</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id7">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setOpacity</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opacity</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id7" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the opacity of all active overlay layers. Layers that have not been used yet will not have their opacity changed. Opacity ranges from <code class="docutils literal notranslate"><span class="pre">0</span></code> (invisible) to <code class="docutils literal notranslate"><span class="pre">100</span></code> (completely opaque).</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opacity</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the opacity</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.getHorizontalScale">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getHorizontalScale</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.getHorizontalScale" title="Permalink to this definition"></a></dt>
<dd><p>Gets the horizontal scale of the specified overlay layer. <code class="docutils literal notranslate"><span class="pre">1.0</span></code> is normal size.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the scale</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.getVerticalScale">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getVerticalScale</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.getVerticalScale" title="Permalink to this definition"></a></dt>
<dd><p>Gets the vertical scale of the specified overlay layer. <code class="docutils literal notranslate"><span class="pre">1.0</span></code> is normal size.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the scale</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setHorizontalScale">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setHorizontalScale</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">scale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setHorizontalScale" title="Permalink to this definition"></a></dt>
<dd><p>Sets the horizontal scale of the specified overlay layer. <code class="docutils literal notranslate"><span class="pre">1.0</span></code> is normal size.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>scale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the scale to set</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id8">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setHorizontalScale</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">scale</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id8" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the horizontal scale of all active overlay layers. Layers that have not been used yet will not have their scale changed. <code class="docutils literal notranslate"><span class="pre">1.0</span></code> is normal size.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>scale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the scale to set</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setVerticalScale">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setVerticalScale</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">scale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setVerticalScale" title="Permalink to this definition"></a></dt>
<dd><p>Sets the vertical scale of the specified overlay layer. <code class="docutils literal notranslate"><span class="pre">1.0</span></code> is normal size.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>scale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the scale to set</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id9">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setVerticalScale</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">scale</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id9" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the vertical scale of all active overlay layers. Layers that have not been used yet will not have their scale changed. <code class="docutils literal notranslate"><span class="pre">1.0</span></code> is normal size.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>scale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the scale to set</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setScale">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setScale</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hScale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vScale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setScale" title="Permalink to this definition"></a></dt>
<dd><p>Sets the horizontal and vertical scale of the specified overlay layer. <code class="docutils literal notranslate"><span class="pre">1.0</span></code> is normal size.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hScale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the horizontal scale to set</p></li>
<li><p><strong>vScale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the vertical scale to set</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id10">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setScale</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hScale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vScale</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id10" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the horizontal and vertical scale of all active overlay layers. Layers that have not been used yet will not have their scale changed. <code class="docutils literal notranslate"><span class="pre">1.0</span></code> is normal size.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hScale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the horizontal scale to set</p></li>
<li><p><strong>vScale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the vertical scale to set</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.getRotation">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getRotation</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.getRotation" title="Permalink to this definition"></a></dt>
<dd><p>Gets the angle the specified overlay layer is rotated to.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the angle the layer is rotated to</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setRotation">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setRotation</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">angle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setRotation" title="Permalink to this definition"></a></dt>
<dd><p>Sets the angle the specified overlay layer is rotated to.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angle</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the angle to set</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id11">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setRotation</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">angle</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id11" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the angle that all active overlay layers are rotated to. Layers that have not been used yet will not have their angle changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angle</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the angle to set</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.rotate">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">rotate</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">degrees</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.rotate" title="Permalink to this definition"></a></dt>
<dd><p>Rotates the specified overlay layer. A positive number of degrees is clockwise rotation, a negative number of degrees is counterclockwise rotation.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>degrees</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number of degrees to rotate</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id12">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">rotate</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">degrees</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id12" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Rotates the all active overlay layers. Layers that have not been used yet will not be rotated. A positive number of degrees is clockwise rotation, a negative number of degrees is counterclockwise rotation.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>degrees</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number of degrees to rotate</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.getX">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getX</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.getX" title="Permalink to this definition"></a></dt>
<dd><p>Gets the x position of the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the pixel x coordinate</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.getY">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getY</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.getY" title="Permalink to this definition"></a></dt>
<dd><p>Gets the y position of the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the pixel y coordinate</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setX">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setX</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setX" title="Permalink to this definition"></a></dt>
<dd><p>Sets the x position of the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel x coordinate</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id13">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setX</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id13" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the x position of all active overlay layers. Layers that have not been used yet will not have their position changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel x coordinate</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setY">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setY</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setY" title="Permalink to this definition"></a></dt>
<dd><p>Sets the y position of the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel y coordinate</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id14">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setY</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id14" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the y position of all active overlay layers. Layers that have not been used yet will not have their position changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel y coordinate</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setClippingRect">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setClippingRect</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setClippingRect" title="Permalink to this definition"></a></dt>
<dd><p>Sets the rectangular clipping region for the specifieid overlay layer. A clipping region will cause the overlay’s rendering to be contained inside it. In other words, any content from the overlay layer will not be visible outside of the specified rectangle.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the rectangle’s pixel x coordinate, 0 is the left edge of the current map. A negative value is where the left map border’s region is</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the rectangle’s pixel y coordinate, 0 is the top edge of the current map. A negative value is where the top map border’s region is</p></li>
<li><p><strong>width</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the rectangle’s pixel width</p></li>
<li><p><strong>height</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the rectangle’s pixel height</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id15">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setClippingRect</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id15" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the rectangular clipping region for all overlay layers. A clipping region will cause the overlay’s rendering to be contained inside it. In other words, any content from the overlay layer will not be visible outside of the specified rectangle.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the rectangle’s pixel x coordinate, 0 is the left edge of the current map. A negative value is where the left map border’s region is</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the rectangle’s pixel y coordinate, 0 is the top edge of the current map. A negative value is where the top map border’s region is</p></li>
<li><p><strong>width</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the rectangle’s pixel width</p></li>
<li><p><strong>height</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the rectangle’s pixel height</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.clearClippingRect">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clearClippingRect</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.clearClippingRect" title="Permalink to this definition"></a></dt>
<dd><p>Clears any clipping for the specified overlay layer. See <code class="docutils literal notranslate"><span class="pre">setClippingRect</span></code> for more info about clipping.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id16">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clearClippingRect</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id16" title="Permalink to this definition"></a></dt>
<dd><p>Clears any clipping for all overlay layers. See <code class="docutils literal notranslate"><span class="pre">setClippingRect</span></code> for more info about clipping.</p>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.getPosition">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getPosition</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.getPosition" title="Permalink to this definition"></a></dt>
<dd><p>Gets the position of the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the layer’s pixel coordinates</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object (<code class="docutils literal notranslate"><span class="pre">{x,</span> <span class="pre">y}</span></code>)</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.setPosition">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setPosition</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.setPosition" title="Permalink to this definition"></a></dt>
<dd><p>Sets the position of the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel x coordinate</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel y coordinate</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id17">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setPosition</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id17" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Sets the position of all active overlay layers. Layers that have not been used yet will not have their position changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel x coordinate</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel y coordinate</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.move">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">move</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">deltaX</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">deltaY</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.move" title="Permalink to this definition"></a></dt>
<dd><p>Moves the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>deltaX</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number of pixels to move horizontally</p></li>
<li><p><strong>deltaY</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number of pixels to move vertically</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id18">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">move</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">deltaX</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">deltaY</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id18" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Moves all active overlay layers. Layers that have not been used yet will not have their position changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>deltaX</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number of pixels to move horizontally</p></li>
<li><p><strong>deltaY</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number of pixels to move vertically</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.addText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">addText</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span> <span class="pre">=</span> <span class="pre">&quot;#000000&quot;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span> <span class="pre">=</span> <span class="pre">12</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.addText" title="Permalink to this definition"></a></dt>
<dd><p>Adds a text item to the specified overlay layer. Text can be additionally formatted with a <a class="reference external" href="https://doc.qt.io/qt-5/richtext-html-subset.html#supported-tags">limited set of HTML tags</a>. Note that only text can be displayed, so text decoration like underlines or table borders will not appear.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the text to display</p></li>
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the x pixel coordinate of the text (relative to the layer’s position)</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the y pixel coordinate of the text (relative to the layer’s position)</p></li>
<li><p><strong>color</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the color of the text. Can be specified as <code class="docutils literal notranslate"><span class="pre">&quot;#RRGGBB&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;#AARRGGBB&quot;</span></code>. Defaults to black.</p></li>
<li><p><strong>size</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the font size of the text. Defaults to 12.</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.addRect">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">addRect</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">borderColor</span> <span class="pre">=</span> <span class="pre">&quot;#000000&quot;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fillColor</span> <span class="pre">=</span> <span class="pre">&quot;&quot;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rounding</span> <span class="pre">=</span> <span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.addRect" title="Permalink to this definition"></a></dt>
<dd><p>Adds a rectangle outline item to the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the x pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the y pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>width</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel width of the rectangle</p></li>
<li><p><strong>height</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the pixel height of the rectangle</p></li>
<li><p><strong>borderColor</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the color of the rectangle’s border. Can be specified as <code class="docutils literal notranslate"><span class="pre">&quot;#RRGGBB&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;#AARRGGBB&quot;</span></code>. Defaults to black.</p></li>
<li><p><strong>fillColor</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the color of the area enclosed by the rectangle. Can be specified as <code class="docutils literal notranslate"><span class="pre">&quot;#RRGGBB&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;#AARRGGBB&quot;</span></code>. Defaults to transparent.</p></li>
<li><p><strong>rounding</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the percent degree the corners will be rounded. <code class="docutils literal notranslate"><span class="pre">0</span></code> is rectangular, <code class="docutils literal notranslate"><span class="pre">100</span></code> is elliptical. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.addPath">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">addPath</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">borderColor</span> <span class="pre">=</span> <span class="pre">&quot;#000000&quot;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fillColor</span> <span class="pre">=</span> <span class="pre">&quot;&quot;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.addPath" title="Permalink to this definition"></a></dt>
<dd><p>Draws a straight path on the specified layer by connecting the coordinate pairs in <code class="docutils literal notranslate"><span class="pre">coords</span></code>. The area enclosed by the path can be colored in, and will follow the <a class="reference external" href="https://doc.qt.io/qt-5/qt.html#FillRule-enum">“odd-even” fill rule</a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>coords</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of pixel coordinates to connect to create the path. Each element of the array should be an array containing an x and y pixel coordinate</p></li>
<li><p><strong>borderColor</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the color of the path. Can be specified as <code class="docutils literal notranslate"><span class="pre">&quot;#RRGGBB&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;#AARRGGBB&quot;</span></code>. Defaults to black.</p></li>
<li><p><strong>fillColor</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the color of the area enclosed by the path. Can be specified as <code class="docutils literal notranslate"><span class="pre">&quot;#RRGGBB&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;#AARRGGBB&quot;</span></code>. Defaults to transparent.</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id19">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">addPath</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xCoords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yCoords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">borderColor</span> <span class="pre">=</span> <span class="pre">&quot;#000000&quot;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fillColor</span> <span class="pre">=</span> <span class="pre">&quot;&quot;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id19" title="Permalink to this definition"></a></dt>
<dd><p>This is an overloaded function. Draws a straight path on the specified layer by connecting the coordinates at (<code class="docutils literal notranslate"><span class="pre">xCoords</span></code>, <code class="docutils literal notranslate"><span class="pre">yCoords</span></code>). The area enclosed by the path can be colored in, and will follow the <a class="reference external" href="https://doc.qt.io/qt-5/qt.html#FillRule-enum">“odd-even” fill rule</a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xCoords</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of x pixel coordinates to connect to create the path</p></li>
<li><p><strong>yCoords</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of y pixel coordinates to connect to create the path</p></li>
<li><p><strong>borderColor</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the color of the path. Can be specified as <code class="docutils literal notranslate"><span class="pre">&quot;#RRGGBB&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;#AARRGGBB&quot;</span></code>. Defaults to black.</p></li>
<li><p><strong>fillColor</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the color of the area enclosed by the path. Can be specified as <code class="docutils literal notranslate"><span class="pre">&quot;#RRGGBB&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;#AARRGGBB&quot;</span></code>. Defaults to transparent.</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.addImage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">addImage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filepath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">useCache</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.addImage" title="Permalink to this definition"></a></dt>
<dd><p>Adds an image item to the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>filepath</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the image’s filepath</p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
<li><p><strong>useCache</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the image should be saved/loaded using the cache. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Reading images from a file is slow. Setting <code class="docutils literal notranslate"><span class="pre">useCache</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> will save the image to memory so that the next time the filepath is encountered the image can be loaded from memory rather than the file.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.createImage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">createImage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filepath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span> <span class="pre">=</span> <span class="pre">-1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span> <span class="pre">=</span> <span class="pre">-1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xOffset</span> <span class="pre">=</span> <span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yOffset</span> <span class="pre">=</span> <span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hScale</span> <span class="pre">=</span> <span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vScale</span> <span class="pre">=</span> <span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">paletteId</span> <span class="pre">=</span> <span class="pre">-1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">setTransparency</span> <span class="pre">=</span> <span class="pre">false</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">useCache</span> <span class="pre">=</span> <span class="pre">true</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.createImage" title="Permalink to this definition"></a></dt>
<dd><p>Creates an image item on the specified overlay layer. This differs from <code class="docutils literal notranslate"><span class="pre">overlay.addImage</span></code> by allowing the new image to be a transformation of the image file.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>filepath</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the image’s filepath</p></li>
<li><p><strong>width</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the width in pixels of the area to read in the image. If <code class="docutils literal notranslate"><span class="pre">-1</span></code>, use the full width of the original image. Defaults to <code class="docutils literal notranslate"><span class="pre">-1</span></code></p></li>
<li><p><strong>height</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the height in pixels of the area to read in the image. If <code class="docutils literal notranslate"><span class="pre">-1</span></code>, use the full height of the original image. Defaults to <code class="docutils literal notranslate"><span class="pre">-1</span></code></p></li>
<li><p><strong>xOffset</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the x pixel coordinate on the original image where data should be read from. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
<li><p><strong>yOffset</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the y pixel coordinate on the original image where data should be read from. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
<li><p><strong>hScale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the horizontal scale for the image. Negative values will be a horizontal flip of the original image. Defaults to <code class="docutils literal notranslate"><span class="pre">1</span></code></p></li>
<li><p><strong>vScale</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the vertical scale for the image. Negative values will be a vertical flip of the original image. Defaults to <code class="docutils literal notranslate"><span class="pre">1</span></code></p></li>
<li><p><strong>paletteId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the id of which currently loaded tileset palette to use for the image. If <code class="docutils literal notranslate"><span class="pre">-1</span></code>, use the original image’s palette. Defaults to <code class="docutils literal notranslate"><span class="pre">-1</span></code></p></li>
<li><p><strong>setTransparency</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to <code class="docutils literal notranslate"><span class="pre">false</span></code></p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
<li><p><strong>useCache</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the image should be saved/loaded using the cache. Defaults to <code class="docutils literal notranslate"><span class="pre">true</span></code>. Reading images from a file is slow. Setting <code class="docutils literal notranslate"><span class="pre">useCache</span></code> to <code class="docutils literal notranslate"><span class="pre">true</span></code> will save the image to memory so that the next time the filepath is encountered the image can be loaded from memory rather than the file.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.addTileImage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">addTileImage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xflip</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yflip</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">palette</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">setTransparency</span> <span class="pre">=</span> <span class="pre">false</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.addTileImage" title="Permalink to this definition"></a></dt>
<dd><p>Creates an image of a tile on the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>tileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – tile value for the image</p></li>
<li><p><strong>xflip</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the tile image is flipped horizontally</p></li>
<li><p><strong>yflip</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the tile image is flipped vertically</p></li>
<li><p><strong>palette</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – palette number for the tile image</p></li>
<li><p><strong>setTransparency</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to <code class="docutils literal notranslate"><span class="pre">false</span></code></p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="id21">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">addTileImage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">setTransparency</span> <span class="pre">=</span> <span class="pre">false</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id21" title="Permalink to this definition"></a></dt>
<dd><p>Creates an image of a tile on the specified overlay layer. This is an overloaded function that takes a single tile as a JavaScript object instead of each of the tile’s properties individually.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>tile</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">object</span></code></span>) – the tile to create an image of. <code class="docutils literal notranslate"><span class="pre">tile</span></code> is an object with the properties <code class="docutils literal notranslate"><span class="pre">{tileId,</span> <span class="pre">xflip,</span> <span class="pre">yflip,</span> <span class="pre">palette}</span></code></p></li>
<li><p><strong>setTransparency</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to <code class="docutils literal notranslate"><span class="pre">false</span></code></p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="overlay.addMetatileImage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">overlay</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">addMetatileImage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metatileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">setTransparency</span> <span class="pre">=</span> <span class="pre">false</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layer</span> <span class="pre">=</span> <span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#overlay.addMetatileImage" title="Permalink to this definition"></a></dt>
<dd><p>Creates an image of a metatile on the specified overlay layer.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>y</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position)</p></li>
<li><p><strong>metatileId</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – id of the metatile to create an image of</p></li>
<li><p><strong>setTransparency</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to <code class="docutils literal notranslate"><span class="pre">false</span></code></p></li>
<li><p><strong>layer</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the layer id. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
<section id="settings-functions">
<h4>Settings Functions<a class="headerlink" href="#settings-functions" title="Permalink to this heading"></a></h4>
<p>The following functions are related to settings.</p>
<p>All settings functions are callable via the global <code class="docutils literal notranslate"><span class="pre">utility</span></code> object.</p>
<dl class="js function">
<dt class="sig sig-object js" id="utility.getGridVisibility">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getGridVisibility</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getGridVisibility" title="Permalink to this definition"></a></dt>
<dd><p>Gets the visibility of the map grid overlay.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>grid visibility</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.setGridVisibility">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setGridVisibility</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">visible</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.setGridVisibility" title="Permalink to this definition"></a></dt>
<dd><p>Sets the visibility of the map grid overlay.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>visible</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – grid visibility</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getBorderVisibility">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getBorderVisibility</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getBorderVisibility" title="Permalink to this definition"></a></dt>
<dd><p>Gets the visibility of the map’s border.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>border visibility</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.setBorderVisibility">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setBorderVisibility</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">visible</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.setBorderVisibility" title="Permalink to this definition"></a></dt>
<dd><p>Sets the visibility of the map’s border.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>visible</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – border visibility</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getSmartPathsEnabled">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSmartPathsEnabled</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getSmartPathsEnabled" title="Permalink to this definition"></a></dt>
<dd><p>Gets the toggle state of smart paths.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>smart paths enabled</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.setSmartPathsEnabled">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setSmartPathsEnabled</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">enabled</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.setSmartPathsEnabled" title="Permalink to this definition"></a></dt>
<dd><p>Sets the toggle state of smart paths.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>enabled</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – smart paths enabled</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getCustomScripts">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getCustomScripts</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getCustomScripts" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of paths to custom scripts.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>string array of custom scripts paths</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getMainTab">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMainTab</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getMainTab" title="Permalink to this definition"></a></dt>
<dd><p>Gets the index of the currently selected main tab. Tabs are indexed from left to right, starting at 0 (<code class="docutils literal notranslate"><span class="pre">0</span></code>: Map, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Events, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Header, <code class="docutils literal notranslate"><span class="pre">3</span></code>: Connections, <code class="docutils literal notranslate"><span class="pre">4</span></code>: Wild Pokemon).</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>current main tab index</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.setMainTab">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMainTab</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tab</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.setMainTab" title="Permalink to this definition"></a></dt>
<dd><p>Sets the currently selected main tab. Tabs are indexed from left to right, starting at 0 (<code class="docutils literal notranslate"><span class="pre">0</span></code>: Map, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Events, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Header, <code class="docutils literal notranslate"><span class="pre">3</span></code>: Connections, <code class="docutils literal notranslate"><span class="pre">4</span></code>: Wild Pokemon).</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tab</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the tab to select</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getMapViewTab">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMapViewTab</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getMapViewTab" title="Permalink to this definition"></a></dt>
<dd><p>Gets the index of the currently selected map view tab. Tabs are indexed from left to right, starting at 0 (<code class="docutils literal notranslate"><span class="pre">0</span></code>: Metatiles, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Collision, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Prefabs).</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>current map view tab index</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>number</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.setMapViewTab">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMapViewTab</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tab</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.setMapViewTab" title="Permalink to this definition"></a></dt>
<dd><p>Sets the currently selected map view tab. Tabs are indexed from left to right, starting at 0 (<code class="docutils literal notranslate"><span class="pre">0</span></code>: Metatiles, <code class="docutils literal notranslate"><span class="pre">1</span></code>: Collision, <code class="docutils literal notranslate"><span class="pre">2</span></code>: Prefabs).</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tab</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – index of the tab to select</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getMetatileLayerOrder">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileLayerOrder</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getMetatileLayerOrder" title="Permalink to this definition"></a></dt>
<dd><p>Gets the order that metatile layers are rendered.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>array of layers. The bottom layer is represented as 0.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.setMetatileLayerOrder">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileLayerOrder</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">order</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.setMetatileLayerOrder" title="Permalink to this definition"></a></dt>
<dd><p>Sets the order that metatile layers are rendered.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>order</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of layers. The bottom layer is represented as 0.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getMetatileLayerOpacity">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileLayerOpacity</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getMetatileLayerOpacity" title="Permalink to this definition"></a></dt>
<dd><p>Gets the opacities that metatile layers are rendered with.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>array of opacities for each layer. The bottom layer is the first element.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.setMetatileLayerOpacity">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setMetatileLayerOpacity</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opacities</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.setMetatileLayerOpacity" title="Permalink to this definition"></a></dt>
<dd><p>Sets the opacities that metatile layers are rendered with.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opacities</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – array of opacities for each layer. The bottom layer is the first element.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
<section id="utility-functions">
<h4>Utility Functions<a class="headerlink" href="#utility-functions" title="Permalink to this heading"></a></h4>
<p>These are some miscellaneous functions that can be very useful when building custom scripts.</p>
<p>All utility functions are callable via the global <code class="docutils literal notranslate"><span class="pre">utility</span></code> object.</p>
<dl class="js function">
<dt class="sig sig-object js" id="utility.registerAction">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">registerAction</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">functionName</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">actionName</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shortcut</span> <span class="pre">=</span> <span class="pre">&quot;&quot;</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.registerAction" title="Permalink to this definition"></a></dt>
<dd><p>Registers a JavaScript function to an action that can be manually triggered in Porymap’s <code class="docutils literal notranslate"><span class="pre">Tools</span></code> menu. Optionally, a keyboard shortcut (e.g. <code class="docutils literal notranslate"><span class="pre">&quot;Ctrl+P&quot;</span></code>) can also be specified, assuming it doesn’t collide with any existing shortcuts used by Porymap. The function specified by <code class="docutils literal notranslate"><span class="pre">functionName</span></code> must have the <code class="docutils literal notranslate"><span class="pre">export</span></code> keyword.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>functionName</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – name of the JavaScript function</p></li>
<li><p><strong>actionName</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – name of the action that will be displayed in the <code class="docutils literal notranslate"><span class="pre">Tools</span></code> menu</p></li>
<li><p><strong>shortcut</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – optional keyboard shortcut</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.registerToggleAction">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">registerToggleAction</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">functionName</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">actionName</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shortcut</span> <span class="pre">=</span> <span class="pre">&quot;&quot;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">checked</span> <span class="pre">=</span> <span class="pre">false</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.registerToggleAction" title="Permalink to this definition"></a></dt>
<dd><p>Registers a JavaScript function to an action that can be manually triggered in Porymap’s <code class="docutils literal notranslate"><span class="pre">Tools</span></code> menu. Optionally, a keyboard shortcut (e.g. <code class="docutils literal notranslate"><span class="pre">&quot;Ctrl+P&quot;</span></code>) can also be specified, assuming it doesn’t collide with any existing shortcuts used by Porymap. A check mark will be toggled next to the action name each time its activated. Whether the check mark is initially present can be set with <code class="docutils literal notranslate"><span class="pre">checked</span></code>. The function specified by <code class="docutils literal notranslate"><span class="pre">functionName</span></code> must have the <code class="docutils literal notranslate"><span class="pre">export</span></code> keyword.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>functionName</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – name of the JavaScript function</p></li>
<li><p><strong>actionName</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – name of the action that will be displayed in the <code class="docutils literal notranslate"><span class="pre">Tools</span></code> menu</p></li>
<li><p><strong>shortcut</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – optional keyboard shortcut</p></li>
<li><p><strong>checked</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the action initially has a check mark. Defaults to <code class="docutils literal notranslate"><span class="pre">false</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.setTimeout">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setTimeout</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delayMs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.setTimeout" title="Permalink to this definition"></a></dt>
<dd><p>This behaves essentially the same as JavaScript’s <code class="docutils literal notranslate"><span class="pre">setTimeout()</span></code> that is used in web browsers or NodeJS. The <code class="docutils literal notranslate"><span class="pre">func</span></code> argument is a JavaScript function (NOT the name of a function) which will be executed after a delay. This is useful for creating animations or refreshing the overlay at constant intervals.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>func</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">function</span></code></span>) – a JavaScript function that will be executed later</p></li>
<li><p><strong>delayMs</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number of milliseconds to wait before executing <code class="docutils literal notranslate"><span class="pre">func</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.log">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">log</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.log" title="Permalink to this definition"></a></dt>
<dd><p>Logs a message to the Porymap log file with the prefix <code class="docutils literal notranslate"><span class="pre">[INFO]</span></code>. This is useful for debugging custom scripts.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>message</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the message to log</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.warn">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">warn</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.warn" title="Permalink to this definition"></a></dt>
<dd><p>Logs a message to the Porymap log file with the prefix <code class="docutils literal notranslate"><span class="pre">[WARN]</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>message</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the message to log</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.error">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">error</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.error" title="Permalink to this definition"></a></dt>
<dd><p>Logs a message to the Porymap log file with the prefix <code class="docutils literal notranslate"><span class="pre">[ERROR]</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>message</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the message to log</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.showMessage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">showMessage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">informativeText</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">detailedText</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.showMessage" title="Permalink to this definition"></a></dt>
<dd><p>Displays a message box with an “Information” icon and an <code class="docutils literal notranslate"><span class="pre">OK</span></code> button. Execution stops while the window is open.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the main message text</p></li>
<li><p><strong>informativeText</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – smaller text below the main message. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
<li><p><strong>detailedText</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – text hidden behind a “Show Details” box. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.showWarning">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">showWarning</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">informativeText</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">detailedText</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.showWarning" title="Permalink to this definition"></a></dt>
<dd><p>Displays a message box with a “Warning” icon and an <code class="docutils literal notranslate"><span class="pre">OK</span></code> button. Execution stops while the window is open.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the main message text</p></li>
<li><p><strong>informativeText</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – smaller text below the main message. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
<li><p><strong>detailedText</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – text hidden behind a “Show Details” box. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.showError">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">showError</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">informativeText</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">detailedText</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.showError" title="Permalink to this definition"></a></dt>
<dd><p>Displays a message box with a “Critical” icon and an <code class="docutils literal notranslate"><span class="pre">OK</span></code> button. Execution stops while the window is open.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the main message text</p></li>
<li><p><strong>informativeText</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – smaller text below the main message. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
<li><p><strong>detailedText</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – text hidden behind a “Show Details” box. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.showQuestion">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">showQuestion</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">informativeText</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">detailedText</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.showQuestion" title="Permalink to this definition"></a></dt>
<dd><p>Displays a message box with a “Question” icon and a <code class="docutils literal notranslate"><span class="pre">Yes</span></code> and a <code class="docutils literal notranslate"><span class="pre">No</span></code> button. Execution stops while the window is open.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the main message text</p></li>
<li><p><strong>informativeText</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – smaller text below the main message. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
<li><p><strong>detailedText</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – text hidden behind a “Show Details” box. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code> if <code class="docutils literal notranslate"><span class="pre">Yes</span></code> was selected, <code class="docutils literal notranslate"><span class="pre">false</span></code> if <code class="docutils literal notranslate"><span class="pre">No</span></code> was selected or if the window was closed without selection</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getInputText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getInputText</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">title</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.getInputText" title="Permalink to this definition"></a></dt>
<dd><p>Displays a text input dialog with an <code class="docutils literal notranslate"><span class="pre">OK</span></code> and a <code class="docutils literal notranslate"><span class="pre">Cancel</span></code> button. Execution stops while the window is open.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>title</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the text in the window title bar</p></li>
<li><p><strong>label</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the text adjacent to the input entry area</p></li>
<li><p><strong>default</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the text in the input entry area when the window is opened. Defaults to <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">input</span></code> will be the input text and <code class="docutils literal notranslate"><span class="pre">ok</span></code> will be <code class="docutils literal notranslate"><span class="pre">true</span></code> if <code class="docutils literal notranslate"><span class="pre">OK</span></code> was selected. <code class="docutils literal notranslate"><span class="pre">input</span></code> will be <code class="docutils literal notranslate"><span class="pre">&quot;&quot;</span></code> and <code class="docutils literal notranslate"><span class="pre">ok</span></code> will be <code class="docutils literal notranslate"><span class="pre">false</span></code> if <code class="docutils literal notranslate"><span class="pre">Cancel</span></code> was selected or if the window was closed without selection.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object (<code class="docutils literal notranslate"><span class="pre">{input,</span> <span class="pre">ok}</span></code>)</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getInputNumber">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getInputNumber</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">title</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">min</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">decimals</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">step</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.getInputNumber" title="Permalink to this definition"></a></dt>
<dd><p>Displays a number input dialog with an <code class="docutils literal notranslate"><span class="pre">OK</span></code> and a <code class="docutils literal notranslate"><span class="pre">Cancel</span></code> button. Execution stops while the window is open.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>title</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the text in the window title bar</p></li>
<li><p><strong>label</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the text adjacent to the input entry area</p></li>
<li><p><strong>default</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number in the input entry area when the window is opened. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
<li><p><strong>min</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the minimum allowable input value. Defaults to <code class="docutils literal notranslate"><span class="pre">-2147483648</span></code></p></li>
<li><p><strong>max</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the maximum allowable input value. Defaults to <code class="docutils literal notranslate"><span class="pre">2147483647</span></code></p></li>
<li><p><strong>decimals</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the number of decimals used for the input number. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
<li><p><strong>step</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the increment by which the input number will change when the spinner is used. Defaults to <code class="docutils literal notranslate"><span class="pre">1</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">input</span></code> will be the input number and <code class="docutils literal notranslate"><span class="pre">ok</span></code> will be <code class="docutils literal notranslate"><span class="pre">true</span></code> if <code class="docutils literal notranslate"><span class="pre">OK</span></code> was selected. <code class="docutils literal notranslate"><span class="pre">input</span></code> will be <code class="docutils literal notranslate"><span class="pre">default</span></code> and <code class="docutils literal notranslate"><span class="pre">ok</span></code> will be <code class="docutils literal notranslate"><span class="pre">false</span></code> if <code class="docutils literal notranslate"><span class="pre">Cancel</span></code> was selected or if the window was closed without selection.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object (<code class="docutils literal notranslate"><span class="pre">{input,</span> <span class="pre">ok}</span></code>)</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getInputItem">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getInputItem</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">title</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">items</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">editable</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.getInputItem" title="Permalink to this definition"></a></dt>
<dd><p>Displays a text input dialog with an items dropdown and an <code class="docutils literal notranslate"><span class="pre">OK</span></code> and a <code class="docutils literal notranslate"><span class="pre">Cancel</span></code> button. Execution stops while the window is open.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>title</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the text in the window title bar</p></li>
<li><p><strong>label</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the text adjacent to the input entry area</p></li>
<li><p><strong>items</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">array</span></code></span>) – an array of text items that will populate the dropdown</p></li>
<li><p><strong>default</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">number</span></code></span>) – the index of the item to select by default. Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
<li><p><strong>editable</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">boolean</span></code></span>) – whether the user is allowed to enter their own text instead. Defaults to <code class="docutils literal notranslate"><span class="pre">false</span></code></p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">input</span></code> will be the input text and <code class="docutils literal notranslate"><span class="pre">ok</span></code> will be <code class="docutils literal notranslate"><span class="pre">true</span></code> if <code class="docutils literal notranslate"><span class="pre">OK</span></code> was selected. <code class="docutils literal notranslate"><span class="pre">input</span></code> will be the text of the item at <code class="docutils literal notranslate"><span class="pre">default</span></code> and <code class="docutils literal notranslate"><span class="pre">ok</span></code> will be <code class="docutils literal notranslate"><span class="pre">false</span></code> if <code class="docutils literal notranslate"><span class="pre">Cancel</span></code> was selected or if the window was closed without selection.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object (<code class="docutils literal notranslate"><span class="pre">{input,</span> <span class="pre">ok}</span></code>)</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getMapNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMapNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getMapNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of map names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of map names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getTilesetNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getTilesetNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getTilesetNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of tileset names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of tileset names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getPrimaryTilesetNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getPrimaryTilesetNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getPrimaryTilesetNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of primary tileset names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of primary tileset names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getSecondaryTilesetNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSecondaryTilesetNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getSecondaryTilesetNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of secondary tileset names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of secondary tileset names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getMetatileBehaviorNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMetatileBehaviorNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getMetatileBehaviorNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of metatile behavior names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of metatile behavior names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getSongNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getSongNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getSongNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of song names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of song names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getLocationNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getLocationNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getLocationNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of map location names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of map location names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getWeatherNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getWeatherNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getWeatherNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of weather names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of weather names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getMapTypeNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getMapTypeNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getMapTypeNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of map type names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of map type names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.getBattleSceneNames">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getBattleSceneNames</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#utility.getBattleSceneNames" title="Permalink to this definition"></a></dt>
<dd><p>Gets the list of battle scene names.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the list of battle scene names</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.isPrimaryTileset">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">isPrimaryTileset</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tilesetName</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.isPrimaryTileset" title="Permalink to this definition"></a></dt>
<dd><p>Gets whether the specified tileset is a primary tileset.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tilesetName</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the tileset name</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>is a primary tileset</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>boolean</p>
</dd>
</dl>
</dd></dl>

<dl class="js function">
<dt class="sig sig-object js" id="utility.isSecondaryTileset">
<span class="sig-prename descclassname"><span class="n"><span class="pre">utility</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">isSecondaryTileset</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tilesetName</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#utility.isSecondaryTileset" title="Permalink to this definition"></a></dt>
<dd><p>Gets whether the specified tileset is a secondary tileset.</p>
<dl class="field-list simple">
<dt class="field-odd">Arguments<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tilesetName</strong> (<span><code class="xref js js-func docutils literal notranslate"><span class="pre">string</span></code></span>) – the tileset name</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>is a secondary tileset</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>boolean</p>
</dd>
</dl>
</dd></dl>

</section>
</section>
<section id="constants">
<h3>Constants<a class="headerlink" href="#constants" title="Permalink to this heading"></a></h3>
<p>Some constant values are provided for convenience. These are read-only properties guaranteed not to change unless a new project is opened or the current one is reloaded.</p>
<p>All constants are accessible via the global <code class="docutils literal notranslate"><span class="pre">constants</span></code> object.</p>
<dl class="js attribute">
<dt class="sig sig-object js" id="constants.max_primary_tiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">max_primary_tiles</span></span></span><a class="headerlink" href="#constants.max_primary_tiles" title="Permalink to this definition"></a></dt>
<dd><p>The maximum number of tiles in a primary tileset.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.max_secondary_tiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">max_secondary_tiles</span></span></span><a class="headerlink" href="#constants.max_secondary_tiles" title="Permalink to this definition"></a></dt>
<dd><p>The maximum number of tiles in a secondary tileset.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.max_primary_metatiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">max_primary_metatiles</span></span></span><a class="headerlink" href="#constants.max_primary_metatiles" title="Permalink to this definition"></a></dt>
<dd><p>The maximum number of metatiles in a primary tileset.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.max_secondary_metatiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">max_secondary_metatiles</span></span></span><a class="headerlink" href="#constants.max_secondary_metatiles" title="Permalink to this definition"></a></dt>
<dd><p>The maximum number of metatiles in a secondary tileset.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.layers_per_metatile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">layers_per_metatile</span></span></span><a class="headerlink" href="#constants.layers_per_metatile" title="Permalink to this definition"></a></dt>
<dd><p>The number of tile layers used in each metatile. This will either be <code class="docutils literal notranslate"><span class="pre">2</span></code> or <code class="docutils literal notranslate"><span class="pre">3</span></code>, depending on the config setting <code class="docutils literal notranslate"><span class="pre">enable_triple_layer_metatiles</span></code>.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.tiles_per_metatile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">tiles_per_metatile</span></span></span><a class="headerlink" href="#constants.tiles_per_metatile" title="Permalink to this definition"></a></dt>
<dd><p>The number of tiles in each metatile. This will either be <code class="docutils literal notranslate"><span class="pre">8</span></code> or <code class="docutils literal notranslate"><span class="pre">12</span></code>, depending on the config setting <code class="docutils literal notranslate"><span class="pre">enable_triple_layer_metatiles</span></code>.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.base_game_version">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">base_game_version</span></span></span><a class="headerlink" href="#constants.base_game_version" title="Permalink to this definition"></a></dt>
<dd><p>The string value of the config setting <code class="docutils literal notranslate"><span class="pre">base_game_version</span></code>. This will either be <code class="docutils literal notranslate"><span class="pre">pokeruby</span></code>, <code class="docutils literal notranslate"><span class="pre">pokefirered</span></code>, or <code class="docutils literal notranslate"><span class="pre">pokeemerald</span></code>.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.version.major">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span><span class="n"><span class="pre">version</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">major</span></span></span><a class="headerlink" href="#constants.version.major" title="Permalink to this definition"></a></dt>
<dd><p>Porymap’s major version number. For example, for Porymap version <code class="docutils literal notranslate"><span class="pre">5.1.0</span></code> this will be <code class="docutils literal notranslate"><span class="pre">5</span></code>.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.version.minor">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span><span class="n"><span class="pre">version</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">minor</span></span></span><a class="headerlink" href="#constants.version.minor" title="Permalink to this definition"></a></dt>
<dd><p>Porymap’s minor version number. For example, for Porymap version <code class="docutils literal notranslate"><span class="pre">5.1.0</span></code> this will be <code class="docutils literal notranslate"><span class="pre">1</span></code>.</p>
</dd></dl>

<dl class="js attribute">
<dt class="sig sig-object js" id="constants.version.patch">
<span class="sig-prename descclassname"><span class="n"><span class="pre">constants</span></span><span class="p"><span class="pre">.</span></span><span class="n"><span class="pre">version</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">patch</span></span></span><a class="headerlink" href="#constants.version.patch" title="Permalink to this definition"></a></dt>
<dd><p>Porymap’s patch version number. For example, for Porymap version <code class="docutils literal notranslate"><span class="pre">5.1.0</span></code> this will be <code class="docutils literal notranslate"><span class="pre">0</span></code>.</p>
</dd></dl>

</section>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="tileset-editor.html" class="btn btn-neutral float-left" title="The Tileset Editor" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="project-files.html" class="btn btn-neutral float-right" title="Project Files" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2023, huderlem.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>